package com.et114.core.utility;

import javax.servlet.http.HttpServletRequest;

import com.et114.core.control.TokenMapClient;

/*
 * @author guanhw
 */
public class TokenMapUtils {
	public static boolean isExistToken ( HttpServletRequest request , TokenMapClient client , byte type ) {
		String url = request.getRequestURI ( );
		String context = request.getContextPath ( ) + "/";
		url = url.replaceFirst ( context , "" );
		String method = request.getParameter ( "method" );
		if ( method != null )  url += ( "." + method ) ; 
		return client.getTokenMap ( ).isExist ( url , type );
	}
}
